/**
 * 
 */
package factorymethod;

/**
 * PatternBox: "Creator" implementation.
 * <ul>
 *   <li>declares the factory method, which returns an object of type Product. Creator may also define a default implementation of the factory method that returns a default ConcreteProduct object.</li>
 *   <li>may call the factory method to create a Product object.</li>
 * </ul>
 * 
 * @author <a href="mailto:dirk.ehms@patternbox.com">Dirk Ehms</a>
 * @author lx
 */
public abstract class Factory {

	/** stores the Creator instance of the Product */
	private Apple apple;

	/** 
	 * The ConcreteCreator implementation have to return a ConcreteProduct.
	 */
	public abstract Apple createApple();

	/** 
	 * This method invokes the ConcreteCreator implementation to create a
	 * ConcreteProduct.
	 */
	public void anOperation() {
		apple = createApple();
	}

}
